﻿<%@ Page Language="C#" MasterPageFile="~/WebSite.Master" AutoEventWireup="true" CodeBehind="BmQCList.aspx.cs"
    Inherits="RN.ERP.Web.Exam.BmQCList" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript" src="../Scripts/ligerUI/js/ligerui.min.js"></script>
    <script type="text/javascript">
        function OpenAlert(text) {
            $.ligerDialog.warn(text);
            return false;
        }
        /*打开添加窗口*/
        function AddOrEditQC(type, qcid) {
            var url, title;
            if (type == 0) {//添加
                url = "../Exam/BmQCInfo.aspx?type=0";
                title = "添加期次";
            }
            else if (type == 1) {//查看
                url = "../Exam/BmQCInfo.aspx?type=1&qcid=" + qcid;
                title = "期次信息";
            }
            else {//update
                qcid = qcid || $("input:checked").eq(0).val();
                if (!qcid) {
                    OpenAlert("请选择要修改的期次！");
                    return false;
                }
                else {
                    url = "../Exam/BmQCInfo.aspx?type=2&qcid=" + qcid;
                    title = "修改期次";
                }
            }
            $.ligerDialog.open({ url: url, width: 600, height: 550, title: title, buttons: [{ text: '关闭', onclick: function (item, dialog) { dialog.close(); } }] });
        }
        function RefreshWin() {
            location.href = location.href;
        }
        function CloseWin(data) {
            if (data == "1") {
                RefreshWin();
            }
        }
        $(function () {
            $(".a_del").click(function () {
                var chk = $("input:checked");
                if (chk.length == 0) {
                    OpenAlert("请选择要删除的期次！");
                    return false;
                }
                else {
                    $.ligerDialog.confirm("确定删除？", DeleteQC);
                    return false;
                }
            });
            $('input[type="checkbox"]').click(function () {
                if ($(this).attr('checked')) {
                    $('input[type="checkbox"]').removeAttr('checked');
                    $(this).attr('checked', 'checked');
                }
            });
        })
        function DeleteQC(arg) {
            if (arg) {
                var chk = $("input:checked");
                var id = chk.eq(0).val();
                $.ajax({
                    async: false,
                    url: "BmQCList.aspx/DelQC",
                    data: "{ 'id':'" + id + "'}",
                    type: "post",
                    cache: false,
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function (data) {
                        var json = eval('(' + data.d + ')');
                        $.ligerDialog.warn(json.Message, "", RefreshWin);
                    }
                });
            }
        }
    </script>
    <style type="text/css">
        
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table width="99%" style="table-layout: fixed; margin-top: 5px;" border="0" cellspacing="0"
        cellpadding="0" align="center">
        <tr>
            <td class="xx_m  tt_xx_l">
            </td>
            <td class="xx_m  tt_xx_icon">
            </td>
            <td style="width: auto;" class="xx_m">
                期次列表
            </td>
            <td style="width: 14px;">
                <img src="../images/xx_r.jpg" width="14" height="33" />
            </td>
        </tr>
        <tr>
            <td class="left_con">
                &nbsp;
            </td>
            <td colspan="2" style="padding-left: 6px; padding-right: 6px;" valign="top">
                <div>
                    <div class="xian">
                        <div class="about_title">期次列表</div>
                        <div class="i-con-cn" id="buttonArea" runat="server">
                            <span id="edit" runat="server">
                                <a style="cursor: pointer;" onclick="AddOrEditQC(2);" class="xtbiao">修改期次</a>
                            </span>
                            <span id="del" runat="server">
                                <a style="cursor: pointer;" class="a_del xtbiao">删除期次</a>
                            </span>
                            <span id="add" runat="server">
                                <a style="cursor: pointer;" onclick="AddOrEditQC(0);" class="xtbiao">添加期次</a>
                            </span>
                        </div>
                    </div>
                    <telerik:RadGrid ID="RadGrid1" runat="server" ShowStatusBar="True" AllowSorting="true"
                        CssClass="tab" AllowFilteringByColumn="false" CellSpacing="0" Culture="zh-CN"
                        GridLines="None" AllowPaging="true" AllowCustomPaging="true" OnNeedDataSource="RadGrid1_NeedDataSource"
                        Width="100%">
                        <MasterTableView AutoGenerateColumns="false" DataKeyNames="ID" NoMasterRecordsText="暂无数据"
                            InsertItemPageIndexAction="ShowItemOnCurrentPage" CommandItemDisplay="Top">
                            <CommandItemSettings ExportToPdfText="Export to PDF" />
                            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="true">
                            </RowIndicatorColumn>
                            <EditFormSettings>
                                <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                </EditColumn>
                            </EditFormSettings>
                            <PagerStyle AlwaysVisible="True" />
                            <CommandItemTemplate>
                            </CommandItemTemplate>
                            <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="True">
                            </ExpandCollapseColumn>
                            <Columns>
                                <telerik:GridTemplateColumn HeaderText="选择" UniqueName="Choose" HeaderStyle-Width="5%"
                                    HeaderStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                        <input id="ckbChoose" type="checkbox" value='<%#Eval("ID") %>' runat="server" />
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="期次名称" UniqueName="Title" HeaderStyle-Width="36%"
                                    HeaderStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                        <a style="cursor: pointer;" onclick='AddOrEditQC(1,<%#Eval("ID") %>);'><%#Eval("Title")%></a>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridBoundColumn DataField="Code" HeaderText="编号" UniqueName="Code" HeaderStyle-Width="10%"
                                    HeaderStyle-HorizontalAlign="Center">
                                </telerik:GridBoundColumn>
                                <telerik:GridTemplateColumn HeaderText="纳入考试人员" UniqueName="ExamineeType" HeaderStyle-Width="15%"
                                    HeaderStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                        <%#GetExamineeTypeText(Eval("ExamineeType"))%></a>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridBoundColumn DataField="StartDate" SortExpression="StartDate" FilterListOptions="VaryByDataType"
                                    HeaderText="报名开始时间" DataFormatString="{0:yyyy-MM-dd}" UniqueName="StartDate"
                                    HeaderStyle-Width="12%" HeaderStyle-HorizontalAlign="Center">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="EndDate" SortExpression="EndDate" FilterListOptions="VaryByDataType"
                                    HeaderText="报名结束时间" DataFormatString="{0:yyyy-MM-dd}" UniqueName="EndDate" HeaderStyle-Width="12%"
                                    HeaderStyle-HorizontalAlign="Center">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="ExamDate" SortExpression="ExamDate" FilterListOptions="VaryByDataType"
                                    HeaderText="考试时间" DataFormatString="{0:yyyy-MM-dd}" UniqueName="ExamDate" HeaderStyle-Width="10%"
                                    HeaderStyle-HorizontalAlign="Center">
                                </telerik:GridBoundColumn>
                            </Columns>
                        </MasterTableView>
                        <ClientSettings EnableRowHoverStyle="true">
                            <Selecting AllowRowSelect="True"></Selecting>
                        </ClientSettings>
                        <PagerStyle AlwaysVisible="True" />
                        <FilterMenu EnableImageSprites="False">
                        </FilterMenu>
                    </telerik:RadGrid>
                </div>
            </td>
            <td class="right_con">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td class="con_m tt_left_bottom">
                &nbsp;
            </td>
            <td colspan="2" class="con_m">
                &nbsp;
            </td>
            <td class="tt_right_bottom">
                &nbsp;
            </td>
        </tr>
    </table>
    <div id="UDialog" style="margin: auto; width: 900px;">
        <telerik:RadAjaxLoadingPanel runat="server" ID="gridLoadingPanel">
        </telerik:RadAjaxLoadingPanel>
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true">
            <Windows>
                <telerik:RadWindow ID="UserDialog" runat="server" Title="期次信息" Height="600px" Behaviors="Close"
                    Width="600px" Left="150px" ReloadOnShow="true" ShowContentDuringLoad="false"
                    Modal="true" Skin="WebBlue" VisibleStatusbar="False" CssClass="DialogCss">
                </telerik:RadWindow>
            </Windows>
        </telerik:RadWindowManager>
    </div>
</asp:Content>
